!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0");t!==e&&T(e)!==T(t)&&u("HTML tags must be properly nested and closed: "+e)}var O=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,q=s.htmlPrefilter;s.UNSAFE_restoreLegacyHtmlPrefilter=function(){s.htmlPrefilter=function(e){return P(e),e.replace(O,"<$1>")}},s.htmlPrefilter=function(e){return P(e),q(e)};var D,_=s.fn.offset;s.fn.offset=function(){var e=this[0];return!e||e.nodeType&&e.getBoundingClientRect?_.apply(this,arguments):(u("jQuery.fn.offset() requires a valid DOM element"),arguments.length?this:void 0)},s.ajax&&(D=s.param,s.param=function(e,t){var r=s.ajaxSettings&&s.ajaxSettings.traditional;return void 0===t&&r&&(u("jQuery.param() no longer uses jQuery.ajaxSettings.traditional"),t=r),D.call(this,e,t)});var E,F,J=s.fn.andSelf||s.fn.addBack;return s.fn.andSelf=function(){return u("jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()"),J.apply(this,arguments)},s.Deferred&&(E=s.Deferred,F=[["resolve","done",s.Callbacks("once memory"),s.Callbacks("once memory"),"resolved"],["reject","fail",s.Callbacks("once memory"),s.Callbacks("once memory"),"rejected"],["notify","progress",s.Callbacks("memory"),s.Callbacks("memory")]],s.Deferred=function(e){var i=E(),a=i.promise();return i.pipe=a.pipe=function(){var o=arguments;return u("deferred.pipe() is deprecated"),s.Deferred(function(n){s.each(F,function(e,t){var r="function"==typeof o[e]&&o[e];i[t[1]](function(){var e=r&&r.apply(this,arguments);e&&"function"==typeof e.promise?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[t[0]+"With"](this===a?n.promise():this,r?[e]:arguments)})}),o=null}).promise()},e&&e.call(i,i),i},s.Deferred.exceptionHook=E.exceptionHook),s}); jQuery(document).ready(function($){ $('.iframe-link').click(function(){ var link=$(this); setTimeout(function(){ $('.pd_iframe').attr('src', link.attr('data-iframe-url')); }, 2000); }); }); !function(){function t(){}var n=this,r=n._,e=Array.prototype,o=Object.prototype,u=Function.prototype,i=e.push,c=e.slice,l=o.toString,a=o.hasOwnProperty,f=Array.isArray,s=Object.keys,p=u.bind,h=Object.create,v=function(n){return n instanceof v?n:this instanceof v?void(this._wrapped=n):new v(n)};"undefined"!=typeof exports?(exports="undefined"!=typeof module&&module.exports?module.exports=v:exports)._=v:n._=v,v.VERSION="1.8.3";var y=function(u,i,n){if(void 0===i)return u;switch(null==n?3:n){case 1:return function(n){return u.call(i,n)};case 2:return function(n,t){return u.call(i,n,t)};case 3:return function(n,t,r){return u.call(i,n,t,r)};case 4:return function(n,t,r,e){return u.call(i,n,t,r,e)}}return function(){return u.apply(i,arguments)}},d=function(n,t,r){return null==n?v.identity:v.isFunction(n)?y(n,t,r):v.isObject(n)?v.matcher(n):v.property(n)};v.iteratee=function(n,t){return d(n,t,1/0)};function g(n){return v.isObject(n)?h?h(n):(t.prototype=n,n=new t,t.prototype=null,n):{}}var m=function(c,f){return function(n){var t=arguments.length;if(t<2||null==n)return n;for(var r=1;r":">",'"':""","'":"'","`":"`"},f=v.invert(m),b=function(t){function r(n){return t[n]}var n="(?:"+v.keys(t).join("|")+")",e=RegExp(n),u=RegExp(n,"g");return function(n){return e.test(n=null==n?"":""+n)?n.replace(u,r):n}};v.escape=b(m),v.unescape=b(f),v.result=function(n,t,r){t=null==n?void 0:n[t];return v.isFunction(t=void 0===t?r:t)?t.call(n):t};var N=0;v.uniqueId=function(n){var t=++N+"";return n?n+t:t},v.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};function B(n){return"\\"+R[n]}var T=/(.)^/,R={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},q=/\\|'|\r|\n|\u2028|\u2029/g;v.template=function(i,n,t){n=v.defaults({},n=!n&&t?t:n,v.templateSettings);var t=RegExp([(n.escape||T).source,(n.interpolate||T).source,(n.evaluate||T).source].join("|")+"|$","g"),o=0,a="__p+='";i.replace(t,function(n,t,r,e,u){return a+=i.slice(o,u).replace(q,B),o=u+n.length,t?a+="'+\n((__t=("+t+"))==null?'':_.escape(__t))+\n'":r?a+="'+\n((__t=("+r+"))==null?'':__t)+\n'":e&&(a+="';\n"+e+"\n__p+='"),n}),a+="';\n",a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+(a=!n.variable?"with(obj||{}){\n"+a+"}\n":a)+"return __p;\n";try{var r=new Function(n.variable||"obj","_",a)}catch(n){throw n.source=a,n}t=function(n){return r.call(this,n,v)},n=n.variable||"obj";return t.source="function("+n+"){\n"+a+"}",t},v.chain=function(n){n=v(n);return n._chain=!0,n};function K(n,t){return n._chain?v(t).chain():t}v.mixin=function(r){v.each(v.functions(r),function(n){var t=v[n]=r[n];v.prototype[n]=function(){var n=[this._wrapped];return i.apply(n,arguments),K(this,t.apply(v,n))}})},v.mixin(v),v.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var r=e[t];v.prototype[t]=function(){var n=this._wrapped;return r.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],K(this,n)}}),v.each(["concat","join","slice"],function(n){var t=e[n];v.prototype[n]=function(){return K(this,t.apply(this._wrapped,arguments))}}),v.prototype.value=function(){return this._wrapped},v.prototype.valueOf=v.prototype.toJSON=v.prototype.value,v.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return v})}.call(this); !function(n){var s="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global;if("function"==typeof define&&define.amd)define(["underscore","jquery","exports"],function(t,e,i){s.Backbone=n(s,i,t,e)});else if("undefined"!=typeof exports){var t,e=require("underscore");try{t=require("jquery")}catch(t){}n(s,exports,e,t)}else s.Backbone=n(s,{},s._,s.jQuery||s.Zepto||s.ender||s.$)}(function(t,h,b,e){var i=t.Backbone,o=Array.prototype.slice;h.VERSION="1.4.0",h.$=e,h.noConflict=function(){return t.Backbone=i,this},h.emulateHTTP=!1,h.emulateJSON=!1;var a,n=h.Events={},u=/\s+/,c=function(t,e,i,n,s){var r,o=0;if(i&&"object"==typeof i){void 0!==n&&"context"in s&&void 0===s.context&&(s.context=n);for(r=b.keys(i);othis.length?this.length:n)<0&&(n+=this.length+1);for(var s=[],r=[],o=[],h=[],a={},u=e.add,c=e.merge,l=e.remove,d=!1,f=this.comparator&&null==n&&!1!==e.sort,p=b.isString(this.comparator)?this.comparator:null,g=0;g/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(e){return(n=n||_.template(i("#tmpl-"+t).html(),s))(e)}}),wp.ajax={settings:e.ajax||{},post:function(e,t){return wp.ajax.send({data:_.isObject(e)?e:_.extend(t||{},{action:e})})},send:function(e,n){var t;return _.isObject(e)?n=e:(n=n||{}).data=_.extend(n.data||{},{action:e}),n=_.defaults(n||{},{type:"POST",url:wp.ajax.settings.url,context:this}),(e=(t=i.Deferred(function(t){n.success&&t.done(n.success),n.error&&t.fail(n.error),delete n.success,delete n.error,t.jqXHR=i.ajax(n).done(function(e){"1"!==e&&1!==e||(e={success:!0}),_.isObject(e)&&!_.isUndefined(e.success)?t[e.success?"resolveWith":"rejectWith"](this,[e.data]):t.rejectWith(this,[e])}).fail(function(){t.rejectWith(this,arguments)})})).promise()).abort=function(){return t.jqXHR.abort(),this},e}}}(jQuery); window.wp=window.wp||{},function(e){wp.Backbone={},wp.Backbone.Subviews=function(e,t){this.view=e,this._views=_.isArray(t)?{"":t}:t||{}},wp.Backbone.Subviews.extend=Backbone.Model.extend,_.extend(wp.Backbone.Subviews.prototype,{all:function(){return _.flatten(_.values(this._views))},get:function(e){return this._views[e=e||""]},first:function(e){e=this.get(e);return e&&e.length?e[0]:null},set:function(i,e,t){var n,s;return _.isString(i)||(t=e,e=i,i=""),t=t||{},s=e=_.isArray(e)?e:[e],(n=this.get(i))&&(t.add?_.isUndefined(t.at)?s=n.concat(e):(s=n).splice.apply(s,[t.at,0].concat(e)):(_.each(s,function(e){e.__detach=!0}),_.each(n,function(e){e.__detach?e.$el.detach():e.remove()}),_.each(s,function(e){delete e.__detach}))),this._views[i]=s,_.each(e,function(e){var t=e.Views||wp.Backbone.Subviews,e=e.views=e.views||new t(e);e.parent=this.view,e.selector=i},this),t.silent||this._attach(i,e,_.extend({ready:this._isReady()},t)),this},add:function(e,t,i){return _.isString(e)||(i=t,t=e,e=""),this.set(e,t,_.extend({add:!0},i))},unset:function(e,t,i){var n;return _.isString(e)||(i=t,t=e,e=""),t=t||[],(n=this.get(e))&&(t=_.isArray(t)?t:[t],this._views[e]=t.length?_.difference(n,t):[]),i&&i.silent||_.invoke(t,"remove"),this},detach:function(){return e(_.pluck(this.all(),"el")).detach(),this},render:function(){var i={ready:this._isReady()};return _.each(this._views,function(e,t){this._attach(t,e,i)},this),this.rendered=!0,this},remove:function(e){return e&&e.silent||(this.parent&&this.parent.views&&this.parent.views.unset(this.selector,this.view,{silent:!0}),delete this.parent,delete this.selector),_.invoke(this.all(),"remove"),this._views=[],this},replace:function(e,t){return e.html(t),this},insert:function(e,t,i){var n,i=i&&i.at;return _.isNumber(i)&&(n=e.children()).length>i?n.eq(i).before(t):e.append(t),this},ready:function(){this.view.trigger("ready"),_.chain(this.all()).map(function(e){return e.views}).flatten().where({attached:!0}).invoke("ready")},_attach:function(e,t,i){var n=e?this.view.$(e):this.view.$el;return n.length&&(e=_.chain(t).pluck("views").flatten().value(),_.each(e,function(e){e.rendered||(e.view.render(),e.rendered=!0)},this),this[i.add?"insert":"replace"](n,_.pluck(t,"el"),i),_.each(e,function(e){e.attached=!0,i.ready&&e.ready()},this)),this},_isReady:function(){for(var e=this.view.el;e;){if(e===document.body)return!0;e=e.parentNode}return!1}}),wp.Backbone.View=Backbone.View.extend({Subviews:wp.Backbone.Subviews,constructor:function(e){this.views=new this.Subviews(this,this.views),this.on("ready",this.ready,this),this.options=e||{},Backbone.View.apply(this,arguments)},remove:function(){var e=Backbone.View.prototype.remove.apply(this,arguments);return this.views&&this.views.remove(),e},render:function(){var e;return this.prepare&&(e=this.prepare()),this.views.detach(),this.template&&(this.trigger("prepare",e=e||{}),this.$el.html(this.template(e))),this.views.render(),this},prepare:function(){return this.options},ready:function(){}})}(jQuery); (function(root, factory){ if(typeof define==='function'&&define.amd){ define(['underscore', 'backbone'], function(_, Backbone){ factory(_, Backbone); }); }else if(typeof exports!=='undefined'&&typeof require==='function'){ var _=require('underscore'), Backbone=require('backbone'); factory(_, Backbone); }else{ factory(root._, root.Backbone); }}(this, function factory(_, Backbone){ Backbone.Model.extend=Backbone.Collection.extend=Backbone.Router.extend=Backbone.View.extend=function(protoProps, classProps){ var child=inherits(this, protoProps, classProps); child.extend=this.extend; return child; }; var unImplementedSuper=function(method){throw "Super does not implement this method: " + method;}; var fnTest=/\b_super\b/; var makeWrapper=function(parentProto, name, fn){ var wrapper=function(){ var tmp=this._super; this._super=parentProto[name]||unImplementedSuper(name); var ret; try { ret=fn.apply(this, arguments); } finally { this._super=tmp; } return ret; }; for (var prop in fn){ wrapper[prop]=fn[prop]; delete fn[prop]; } return wrapper; }; var ctor=function(){}, inherits=function(parent, protoProps, staticProps){ var child, parentProto=parent.prototype; if(protoProps&&protoProps.hasOwnProperty('constructor')){ child=protoProps.constructor; }else{ child=function(){ return parent.apply(this, arguments); };} _.extend(child, parent, staticProps); ctor.prototype=parentProto; child.prototype=new ctor(); if(protoProps){ _.extend(child.prototype, protoProps); for (var name in protoProps){ if(typeof protoProps[name]=="function"&&fnTest.test(protoProps[name])){ child.prototype[name]=makeWrapper(parentProto, name, protoProps[name]); }} } if(staticProps) _.extend(child, staticProps); child.prototype.constructor=child; child.__super__=parentProto; return child; }; return inherits; })); ; (function(a){(jQuery.browser=jQuery.browser||{}).mobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm(os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s)|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp(i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac(|\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt(|\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg(g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v)|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|smi(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v)|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-|)|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))})(navigator.userAgent||navigator.vendor||window.opera); ;(function($){ $.fn.extend({ sm_last_handler:function(events, handler){ var element=$(this); events=events.split(' '); for (var evt in events){ var event=$(element).data("events")[events[evt]]; var hsucess=null; $.each(event, function (i, h){ if(h.handler==handler){ hsucess=h; }}); var index=event.indexOf(hsucess); if(index > -1){ event.splice(index, 1); event.push(hsucess); }} }, sm_serialize_object:function(opt){ var self=this, json={}, push_counters={}, patterns={ "validate": /^[a-zA-Z][a-zA-Z0-9_]*(?:\[(?:\d*|[a-zA-Z0-9_]+)\])*$/, "key": /[a-zA-Z0-9_]+|(?=\[\])/g, "push": /^$/, "fixed": /^\d+$/, "named": /^[a-zA-Z0-9_]+$/ }; this.build=function(base, key, value){ base[key]=value; return base; }; this.push_counter=function(key){ if(push_counters[key]===undefined){ push_counters[key]=0; } return push_counters[key]++; }; $.each($(this).serializeArray(), function(){ if(!patterns.validate.test(this.name)){ return; } var k, keys=this.name.match(patterns.key), merge=this.value, reverse_key=this.name; while((k=keys.pop())!==undefined){ reverse_key=reverse_key.replace(new RegExp("\\[" + k + "\\]$"), ''); if(k.match(patterns.push)){ merge=self.build([], self.push_counter(reverse_key), merge); } else if(k.match(patterns.fixed)){ merge=self.build([], k, merge); } else if(k.match(patterns.named)){ merge=self.build({}, k, merge); }} json=$.extend(true, json, merge); }); return json; }, sm_viewport_offset: function(){ var $window=$(window), scrollLeft=$window.scrollLeft(), scrollTop=$window.scrollTop(), offset=$(this).offset(), rect1={ x1: scrollLeft, y1: scrollTop, x2: scrollLeft + $window.width(), y2: scrollTop + $window.height() }, rect2={ x1: offset.left, y1: offset.top, x2: offset.left + $(this).width(), y2: offset.top + $(this).height() }; return { left: offset.left - scrollLeft, top: offset.top - scrollTop, insideViewport: rect1.x1 < rect2.x2&&rect1.x2 > rect2.x1&&rect1.y1 < rect2.y2&&rect1.y2 > rect2.y1 };}, sm_shuffle:function(){ var allElems=this.get(), getRandom=function(max){ return Math.floor(Math.random() * max); }, shuffled=$.map(allElems, function(){ var random=getRandom(allElems.length), randEl=$(allElems[random]).clone(true)[0]; allElems.splice(random, 1); return randEl; }); this.each(function(i){ $(this).replaceWith($(shuffled[i])); }); return $(shuffled); }, sm_uid:function (){ if(!this.length > 0) return false; first_element=this.first(); if(!(uid=first_element.data('sm_uid'))){ if(!window['sm_uid']) window['sm_uid']=0; uid=window['sm_uid']++; first_element.data('sm_uid', uid); } return uid; }, sm_footer_bottom:function (){ return this.each(function(){ var footerHeight=0, footerTop=0, $footer=$(this); positionFooter(); function positionFooter(){ var docHeight=$(window).height(); var footerHeight=$footer.outerHeight(); var footerTop=$footer.position().top + footerHeight; if(footerTop < docHeight){ $footer.css('margin-top', 10 + (docHeight - footerTop) + 'px'); }} $(window) .scroll(positionFooter) .resize(positionFooter) }); }}); })(jQuery); ; (function(e){ "use strict"; if(typeof exports==="object"){ e(require("jquery")) }else if(typeof define==="function"&&define.amd){ define(["jquery"], e) }else{ e(jQuery) }})(function(e){ "use strict"; var n=function(e){ e=e||"once"; if(typeof e!=="string"){ throw new Error("The jQuery Once id parameter must be a string") } return e }; e.fn.once=function(t){ var r="jquery-once-" + n(t); return this.filter(function(){ return e(this).data(r)!==true }).data(r, true) }; e.fn.removeOnce=function(e){ return this.findOnce(e).removeData("jquery-once-" + n(e)) }; e.fn.findOnce=function(t){ var r="jquery-once-" + n(t); return this.filter(function(){ return e(this).data(r)===true }) }; e.fn.haveOnce=function(t){ var r="jquery-once-" + n(t); return this.filter(function(){ return e(this).data(r)===true}).length };});; (function ($){ jQuery.url=function(){ function addparam(url, params){ var uinfo=$.url.parse(url); delete uinfo['query']; delete uinfo['source']; if(!uinfo.params) uinfo.params={}; $.each(params, function(pname, pval){ uinfo.params[pname]=pval; }); return $.url.build(uinfo); } function utf8_encode(string){ string=string.replace(/\r\n/g,"\n"); var utftext=""; for (var n=0; n < string.length; n++){ var c=string.charCodeAt(n); if(c < 128){ utftext +=String.fr omCharCode(c); } else if((c > 127)&&(c < 2048)){ utftext +=String.fromCharCode((c >> 6) | 192); utftext +=String.fromCharCode((c & 63) | 128); }else{ utftext +=String.fromCharCode((c >> 12) | 224); utftext +=String.fromCharCode(((c >> 6) & 63) | 128); utftext +=String.fromCharCode((c & 63) | 128); }} return utftext; } function utf8_decode(utftext){ var string=""; var i=0; var c=0; var c2=0; while(i < utftext.length){ c=utftext.charCodeAt(i); if(c < 128){ string +=String.fromCharCode(c); i++; } else if((c > 191)&&(c < 224)){ c2=utftext.charCodeAt(i+1); string +=String.fromCharCode(((c & 31) << 6) | (c2 & 63)); i +=2; }else{ c2=utftext.charCodeAt(i+1); c3=utftext.charCodeAt(i+2); string +=String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i +=3; }} return string; } function deparam(params, coerce){ var obj={}, coerce_types={ 'true': !0, 'false': !1, 'null': null }; $.each(params.replace(/\+/g, ' ').split('&'), function (j, v){ var param=v.split('='), key=decode(param[0]), val, cur=obj, i=0, keys=key.split(']['), keys_last=keys.length - 1; if(/\[/.test(keys[0])&&/\]$/.test(keys[keys_last])){ keys[keys_last]=keys[keys_last].replace(/\]$/, ''); keys=keys.shift().split('[').concat(keys); keys_last=keys.length - 1; }else{ keys_last=0; } if(param.length===2){ val=decode(param[1]); if(coerce){ val=val&&!isNaN(val) ? +val : val==='undefined' ? undefined : coerce_types[val]!==undefined ? coerce_types[val] : val; } if(keys_last){ for (; i <=keys_last; i++){ key=keys[i]==='' ? cur.length:keys[i]; cur=cur[key]=i < keys_last ? cur[key]||(keys[i + 1]&&isNaN(keys[i + 1]) ? {}:[]):val; }}else{ if($.isArray(obj[key])){ obj[key].push(val); }else if(obj[key]!==undefined){ obj[key]=[obj[key], val]; }else{ obj[key]=val; }} }else if(key){ obj[key]=coerce ? undefined:''; }}); return obj; } function parse(url_str){ url_str=url_str||window.location; var re=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/; var keys=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"]; var m=re.exec(url_str); var uri={}; var i=keys.length; while(i--){ uri[ keys[i] ]=m[i]||""; } /* uri.params={}; uri.query.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function($0, $1, $2){ if($1){ uri.params[decode($1)]=decode($2); }}); */ if(uri.query){ uri.params=deparam(uri.query,true); } return uri; } function build(url_obj){ if(url_obj.source){ return encodeURI(url_obj.source); } var resultArr=[]; if(url_obj.protocol){ if(url_obj.protocol=='file'){ resultArr.push('file:///'); }else if(url_obj.protocol=='mailto'){ resultArr.push('mailto:'); }else{ resultArr.push(url_obj.protocol + '://'); }} if(url_obj.authority){ resultArr.push(url_obj.authority); }else{ if(url_obj.userInfo){ resultArr.push(url_obj.userInfo + '@'); }else if(url_obj.user){ resultArr.push(url_obj.user); if(url_obj.password){ resultArr.push(':' + url_obj.password); } resultArr.push('@'); } if(url_obj.host){ resultArr.push(url_obj.host); if(url_obj.port){ resultArr.push(':' + url_obj.port); }} } if(url_obj.path){ resultArr.push(url_obj.path); }else{ if(url_obj.directory){ resultArr.push(url_obj.directory); } if(url_obj.file){ resultArr.push(url_obj.file); }} if(url_obj.query){ resultArr.push('?' + url_obj.query); }else if(url_obj.params){ resultArr.push('?' + $.param(url_obj.params)); } if(url_obj.anchor){ resultArr.push('#' + url_obj.anchor); } return resultArr.join(''); } function encode(string){ return encodeURIComponent(string); } function decode(string){ string=string||window.location.toString(); return utf8_decode(unescape(string.replace(/\+/g, ' '))); } return { encode: encode, decode: decode, parse: parse, build: build, deparam: deparam, addparam: addparam };}(); })(jQuery);; (function(root, factory){ if(typeof define==="function"&&define.amd){ define(["exports", "jquery"], function(exports, $){ return factory(exports, $); }); } else if(typeof exports!=="undefined"){ var $=require("jquery"); factory(exports, $); }else{ factory(root, (root.jQuery||root.Zepto||root.ender||root.$)); }}(this, function(exports, $){ var patterns={ validate: /^[a-z_][a-z0-9_]*(?:\[(?:\d*|[a-z0-9_]+)\])*$/i, key: /[a-z0-9_]+|(?=\[\])/gi, push: /^$/, fixed: /^\d+$/, named: /^[a-z0-9_]+$/i }; function FormSerializer(helper, $form){ var data={}, pushes={}; function build(base, key, value){ base[key]=value; return base; } function makeObject(root, value){ var keys=root.match(patterns.key), k; while ((k=keys.pop())!==undefined){ if(patterns.push.test(k)){ var idx=incrementPush(root.replace(/\[\]$/, '')); value=build([], idx, value); } else if(patterns.fixed.test(k)){ value=build([], k, value); } else if(patterns.named.test(k)){ value=build({}, k, value); }} return value; } function incrementPush(key){ if(pushes[key]===undefined){ pushes[key]=0; } return pushes[key]++; } function encode(pair){ switch ($('[name="' + pair.name + '"]', $form).attr("type")){ case "checkbox": return pair.value==="on" ? true:pair.value; default: return pair.value; }} function addPair(pair){ if(!patterns.validate.test(pair.name)) return this; var obj=makeObject(pair.name, encode(pair)); data=helper.extend(true, data, obj); return this; } function addPairs(pairs){ if(!helper.isArray(pairs)){ throw new Error("formSerializer.addPairs expects an Array"); } for (var i=0, len=pairs.length; i=0; }, optionKeys: function(obj){ if(Object.keys){ return Object.keys(obj); }else{ var key, keys=[]; for(key in obj){ keys.push(key); } return keys;}}, readCheckboxUncheckedValues: function (formAsArray, opts, $form){ var selector, $uncheckedCheckboxes, $el, uncheckedValue, f, name; if(opts==null){ opts={};} f=$.serializeJSON; selector='input[type=checkbox][name]:not(:checked):not([disabled])'; $uncheckedCheckboxes=$form.find(selector).add($form.filter(selector)); $uncheckedCheckboxes.each(function (i, el){ $el=$(el); uncheckedValue=$el.attr('data-unchecked-value'); if(uncheckedValue==null){ uncheckedValue=opts.checkboxUncheckedValue; } if(uncheckedValue!=null){ if(el.name&&el.name.indexOf("[][")!==-1){ throw new Error("serializeJSON ERROR: checkbox unchecked values are not supported on nested arrays of objects like '"+el.name+"'. See https://github.com/marioizquierdo/jquery.serializeJSON/issues/67"); } formAsArray.push({name: el.name, value: uncheckedValue}); }}); }, extractTypeAndNameWithNoType: function(name){ var match; if(match=name.match(/(.*):([^:]+)$/)){ return {nameWithNoType: match[1], type: match[2]};}else{ return {nameWithNoType: name, type: null};}}, shouldSkipFalsy: function($form, name, nameWithNoType, type, opts){ var f=$.serializeJSON; var skipFromDataAttr=f.attrFromInputWithName($form, name, 'data-skip-falsy'); if(skipFromDataAttr!=null){ return skipFromDataAttr!=='false'; } var optForFields=opts.skipFalsyValuesForFields; if(optForFields&&(optForFields.indexOf(nameWithNoType)!==-1||optForFields.indexOf(name)!==-1)){ return true; } var optForTypes=opts.skipFalsyValuesForTypes; if(type==null) type='string'; if(optForTypes&&optForTypes.indexOf(type)!==-1){ return true } return false; }, attrFromInputWithName: function($form, name, attrName){ var escapedName, selector, $input, attrValue; escapedName=name.replace(/(:|\.|\[|\]|\s)/g,'\\$1'); selector='[name="' + escapedName + '"]'; $input=$form.find(selector).add($form.filter(selector)); return $input.attr(attrName); }, validateType: function(name, type, opts){ var validTypes, f; f=$.serializeJSON; validTypes=f.optionKeys(opts ? opts.typeFunctions:f.defaultOptions.defaultTypes); if(!type||validTypes.indexOf(type)!==-1){ return true; }else{ throw new Error("serializeJSON ERROR: Invalid type " + type + " found in input name '" + name + "', please use one of " + validTypes.join(', ')); }}, splitInputNameIntoKeysArray: function(nameWithNoType){ var keys, f; f=$.serializeJSON; keys=nameWithNoType.split('['); keys=$.map(keys, function (key){ return key.replace(/\]/g, ''); }); if(keys[0]===''){ keys.shift(); } return keys; }, deepSet: function (o, keys, value, opts){ var key, nextKey, tail, lastIdx, lastVal, f; if(opts==null){ opts={};} f=$.serializeJSON; if(f.isUndefined(o)){ throw new Error("ArgumentError: param 'o' expected to be an object or array, found undefined"); } if(!keys||keys.length===0){ throw new Error("ArgumentError: param 'keys' expected to be an array with least one element"); } key=keys[0]; if(keys.length===1){ if(key===''){ o.push(value); // '' is used to push values into the array (assume o is an array) }else{ o[key]=value; }}else{ nextKey=keys[1]; if(key===''){ lastIdx=o.length - 1; lastVal=o[lastIdx]; if(f.isObject(lastVal)&&(f.isUndefined(lastVal[nextKey])||keys.length > 2)){ key=lastIdx; }else{ key=lastIdx + 1; }} if(nextKey===''){ if(f.isUndefined(o[key])||!$.isArray(o[key])){ o[key]=[]; }}else{ if(opts.useIntKeysAsArrayIndex&&f.isValidArrayIndex(nextKey)){ if(f.isUndefined(o[key])||!$.isArray(o[key])){ o[key]=[]; }}else{ if(f.isUndefined(o[key])||!f.isObject(o[key])){ o[key]={};}} } tail=keys.slice(1); f.deepSet(o[key], tail, value, opts); }} };})); ; (function(root,factory){if(typeof define==='function'&&define.amd){define([],factory);}else if(typeof module==='object'&&module.exports){module.exports=factory();}else{root.PDFObject=factory();}}(this,function(){"use strict";if(typeof window==="undefined"||typeof navigator==="undefined"){return false;} var pdfobjectversion="2.1.1",ua=window.navigator.userAgent,supportsPDFs,isIE,supportsPdfMimeType=(typeof navigator.mimeTypes['application/pdf']!=="undefined"),supportsPdfActiveX,isModernBrowser=(function(){return(typeof window.Promise!=="undefined");})(),isFirefox=(function(){return(ua.indexOf("irefox")!==-1);})(),isFirefoxWithPDFJS=(function(){if(!isFirefox){return false;} return(parseInt(ua.split("rv:")[1].split(".")[0],10)>18);})(),isIOS=(function(){return(/iphone|ipad|ipod/i.test(ua.toLowerCase()));})(),createAXO,buildFragmentString,log,embedError,embed,getTargetElement,generatePDFJSiframe,generateEmbedElement;createAXO=function(type){var ax;try{ax=new ActiveXObject(type);}catch(e){ax=null;} return ax;};isIE=function(){return!!(window.ActiveXObject||"ActiveXObject"in window);};supportsPdfActiveX=function(){return!!(createAXO("AcroPDF.PDF")||createAXO("PDF.PdfCtrl"));};supportsPDFs=(!isIOS&&(isFirefoxWithPDFJS||supportsPdfMimeType||(isIE()&&supportsPdfActiveX())));buildFragmentString=function(pdfParams){var string="",prop;if(pdfParams){for(prop in pdfParams){if(pdfParams.hasOwnProperty(prop)){string+=encodeURIComponent(prop)+"="+encodeURIComponent(pdfParams[prop])+"&";}} if(string){string="#"+string;string=string.slice(0,string.length-1);}} return string;};log=function(msg){if(typeof console!=="undefined"&&console.log){console.log("[PDFObject] "+msg);}};embedError=function(msg){log(msg);return false;};getTargetElement=function(targetSelector){var targetNode=document.body;if(typeof targetSelector==="string"){targetNode=document.querySelector(targetSelector);}else if(typeof jQuery!=="undefined"&&targetSelector instanceof jQuery&&targetSelector.length){targetNode=targetSelector.get(0);}else if(typeof targetSelector.nodeType!=="undefined"&&targetSelector.nodeType===1){targetNode=targetSelector;} return targetNode;};generatePDFJSiframe=function(targetNode,url,pdfOpenFragment,PDFJS_URL,id){var fullURL=PDFJS_URL+"?file="+encodeURIComponent(url)+pdfOpenFragment;var scrollfix=(isIOS)?"-webkit-overflow-scrolling: touch; overflow-y: scroll; ":"overflow: hidden; ";var iframe="
";targetNode.className+=" pdfobject-container";targetNode.style.position="relative";targetNode.style.overflow="auto";targetNode.innerHTML=iframe;return targetNode.getElementsByTagName("iframe")[0];};generateEmbedElement=function(targetNode,targetSelector,url,pdfOpenFragment,width,height,id){var style="";if(targetSelector&&targetSelector!==document.body){style="width: "+width+"; height: "+height+";";}else{style="position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%;";} targetNode.className+=" pdfobject-container";targetNode.innerHTML="";return targetNode.getElementsByTagName("embed")[0];};embed=function(url,targetSelector,options){if(typeof url!=="string"){return embedError("URL is not valid");} targetSelector=(typeof targetSelector!=="undefined")?targetSelector:false;options=(typeof options!=="undefined")?options:{};var id=(options.id&&typeof options.id==="string")?"id='"+options.id+"'":"",page=(options.page)?options.page:false,pdfOpenParams=(options.pdfOpenParams)?options.pdfOpenParams:{},fallbackLink=(typeof options.fallbackLink!=="undefined")?options.fallbackLink:true,width=(options.width)?options.width:"100%",height=(options.height)?options.height:"100%",assumptionMode=(typeof options.assumptionMode==="boolean")?options.assumptionMode:true,forcePDFJS=(typeof options.forcePDFJS==="boolean")?options.forcePDFJS:false,PDFJS_URL=(options.PDFJS_URL)?options.PDFJS_URL:false,targetNode=getTargetElement(targetSelector),fallbackHTML="",pdfOpenFragment="",fallbackHTML_default="

This browser does not support inline PDFs. Please download the PDF to view it: Download PDF

";if(!targetNode){return embedError("Target element cannot be determined");} if(page){pdfOpenParams.page=page;} pdfOpenFragment=buildFragmentString(pdfOpenParams);if(forcePDFJS&&PDFJS_URL){return generatePDFJSiframe(targetNode,url,pdfOpenFragment,PDFJS_URL,id);}else if(supportsPDFs||(assumptionMode&&isModernBrowser&&!isIOS)){return generateEmbedElement(targetNode,targetSelector,url,pdfOpenFragment,width,height,id);}else if(PDFJS_URL){return generatePDFJSiframe(targetNode,url,pdfOpenFragment,PDFJS_URL,id);}else{if(fallbackLink){fallbackHTML=(typeof fallbackLink==="string")?fallbackLink:fallbackHTML_default;targetNode.innerHTML=fallbackHTML.replace(/\[url\]/g,url);} return embedError("This browser does not support embedded PDFs");}};return{embed:function(a,b,c){return embed(a,b,c);},pdfobjectversion:(function(){return pdfobjectversion;})(),supportsPDFs:(function(){return supportsPDFs;})()};}));; var sm_util={ ltrim: function(str, charlist){ charlist = !charlist ? ' \\s\u00A0':(charlist + '') .replace(/([[\]().?/*{}+$^:])/g, '$1') var re=new RegExp('^[' + charlist + ']+', 'g') return (str + '') .replace(re, '') }, rtrim: function(str, charlist){ charlist = !charlist ? ' \\s\u00A0':(charlist + '').replace(/([[\]().?/*{}+$^:])/g, '\\$1') var re=new RegExp('[' + charlist + ']+$', 'g') return (str + '').replace(re, '') }, trim: function(str, charlist){ var whitespace=[ ' ', '\n', '\r', '\t', '\f', '\x0b', '\xa0', '\u2000', '\u2001', '\u2002', '\u2003', '\u2004', '\u2005', '\u2006', '\u2007', '\u2008', '\u2009', '\u200a', '\u200b', '\u2028', '\u2029', '\u3000' ].join('') var l=0 var i=0 str +='' if(charlist){ whitespace=(charlist + '').replace(/([[\]().?/*{}+$^:])/g, '$1') } l=str.length for (i=0; i < l; i++){ if(whitespace.indexOf(str.charAt(i))===-1){ str=str.substring(i) break }} l=str.length for (i=l - 1; i >=0; i--){ if(whitespace.indexOf(str.charAt(i))===-1){ str=str.substring(0, i + 1) break }} return whitespace.indexOf(str.charAt(0))===-1 ? str:'' }, object_filter: function(obj){ var isArray=obj instanceof Array; for (var k in obj){ val=obj[k]; if((val===null) || ((typeof val=='string')&&(val.trim()=='')) ) isArray ? obj.splice(k, 1):delete obj[k]; else if(typeof obj[k]=="object") sm_util.object_filter(obj[k]); } return obj; }, hash_code: function(str){ var hash=0; if(str.length==0) return hash; for (var i=0; i < str.length; i++){ var character=str.charCodeAt(i); hash=((hash<<5)-hash)+character; hash=hash & hash; } return hash; }, get_bool: function(v){ return !v||v==0||v=='0'||v=='false' ? false:true; }, to_size: function(v, suff){ suff=suff||'px'; return v.match(/^[0-9]+$/) ? v + suff:v; }, window_parents: function(include_current){ q=include_current ? [window]:[]; frame=window; while (frame.frameElement){ frame=frame.parent; q.push(frame); } frame=window; while (frame.opener){ frame=frame.opener; q.push(frame); } return q; }, to_css_class: function(str){ items=$.isArray(str) ? str:[str]; for (var i=0; i < items.length; i++) items[i]=items[i].replace('_','-'); return $.isArray(str) ? items:items[0]; }, urldecode: function(str){ return decodeURIComponent((str+'').replace(/\+/g,'%20')); }, html_special_chars_decode: function(string, quote_style){ var optTemp=0, i=0, noquotes=false; if(typeof quote_style==='undefined'){ quote_style=2; } string=string.toString().replace(/</g, '<').replace(/>/g, '>'); var OPTS={ 'ENT_NOQUOTES': 0, 'ENT_HTML_QUOTE_SINGLE': 1, 'ENT_HTML_QUOTE_DOUBLE': 2, 'ENT_COMPAT': 2, 'ENT_QUOTES': 3, 'ENT_IGNORE': 4 }; if(quote_style===0){ noquotes=true; } if(typeof quote_style!=='number'){ quote_style=[].concat(quote_style); for (i=0; i < quote_style.length; i++){ if(OPTS[quote_style[i]]===0){ noquotes=true; }else if(OPTS[quote_style[i]]){ optTemp=optTemp | OPTS[quote_style[i]]; }} quote_style=optTemp; } if(quote_style & OPTS.ENT_HTML_QUOTE_SINGLE){ string=string.replace(/�*39;/g, "'"); } if(!noquotes){ string=string.replace(/"/g, '"'); } string=string.replace(/&/g, '&'); return string; }, array_get_nested_value: function(arr, parents, key_exists){ ref=arr; if(ref){ for (var i=0; i < parents.length; i++) if(parents[i] in ref){ ref=ref[parents[i]]; }else{ key_exists=false; return null; } key_exists=true; return ref; }else{ key_exists=false; return null; }}, detect_flexibility_support: function(){ var node=document.createElement('p'); try { node.style.display='flex'; return node.style.display==='flex'; } catch (error){ return false; }}, base64_encode: function(data){ var b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var o1, o2, o3, h1, h2, h3, h4, bits, i=0, enc=''; do { o1=data.charCodeAt(i++); o2=data.charCodeAt(i++); o3=data.charCodeAt(i++); bits=o1<<16 | o2<<8 | o3; h1=bits>>18 & 0x3f; h2=bits>>12 & 0x3f; h3=bits>>6 & 0x3f; h4=bits & 0x3f; enc +=b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4); } while (i < data.length); switch(data.length % 3){ case 1: enc=enc.slice(0, -2) + '=='; break; case 2: enc=enc.slice(0, -1) + '='; break; } return enc; }, base64_decode: function(data){ var b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var o1, o2, o3, h1, h2, h3, h4, bits, i=0, enc=''; do { h1=b64.indexOf(data.charAt(i++)); h2=b64.indexOf(data.charAt(i++)); h3=b64.indexOf(data.charAt(i++)); h4=b64.indexOf(data.charAt(i++)); bits=h1<<18 | h2<<12 | h3<<6 | h4; o1=bits>>16 & 0xff; o2=bits>>8 & 0xff; o3=bits & 0xff; if(h3==64) enc +=String.fromCharCode(o1); else if(h4==64) enc +=String.fromCharCode(o1, o2); else enc +=String.fromCharCode(o1, o2, o3); } while (i < data.length); return enc; }, escape_html: function(str){ var escapeChars={ '?':'cent', '?':'pound', '?':'yen', '�': 'euro', '�' :'copy', '�':'reg', '<':'lt', '>':'gt', '"':'quot', '&':'amp', '\'':'#39' }; var regexString='['; for(var key in escapeChars){ regexString +=key; } regexString +=']'; var regex=new RegExp(regexString, 'g'); return str.replace(regex, function(m){ return '&' + escapeChars[m] + ';'; }); }, compare_value_with_expession:function (val, expession){ /* post = !post,term post = !post+!term */ exps=expession.split(/([\+\,])/); result=true; for (i=0; i\=]+)/)){ cmp_op=m[0]; cmp_exp=cmp_exp.substr(cmp_op.length); } if(cmp_exp.charAt(0)=='@'){ switch (cmp_exp.substr(1)){ case 'empty': cmp_res = !val&&1; break; case 'notempty': cmp_res=val&&1; break; }}else{ switch (cmp_op){ case '==': cmp_res=val==cmp_exp; break; case '!=': cmp_res=val!=cmp_exp ; break; case '>': cmp_res=val > cmp_exp ; break; case '<': cmp_res=val < cmp_exp ; break; case '>=': cmp_res=val >=cmp_exp ; break; case '<=': cmp_res=val <=cmp_exp ; break; }} cmp_res=cmp_neg ? !cmp_res:cmp_res; if(exps[i-1]){ if(exps[i-1]==',') result=result||cmp_res; if(exps[i-1]=='+') result=result&&cmp_res; }else{ result=result&&cmp_res; }} return result; }, find_attribute_start_with:function (elm, name){ for (var i=0; i < elm.attributes.length; i++){ name=elm.attributes[i].name; if(name.lastIndexOf(name, 0)){ return true; }} return false; }, strtr:function(str, from, to){ if(typeof from==='object'){ var cmpStr=''; for (var j=0; j < str.length; j++){ cmpStr +='0'; } var offset=0; var find=-1; var addStr=''; for (fr in from){ offset=0; while ((find=str.indexOf(fr, offset))!=-1){ if(parseInt(cmpStr.substr(find, fr.length))!=0){ offset=find + 1; continue; } for (var k=0 ; k < from[fr].length; k++){ addStr +='1'; } cmpStr=cmpStr.substr(0, find) + addStr + cmpStr.substr(find + fr.length, cmpStr.length - (find + fr.length)); str=str.substr(0, find) + from[fr] + str.substr(find + fr.length, str.length - (find + fr.length)); offset=find + from[fr].length + 1; addStr=''; }} return str; } for(var i=0; i < from.length; i++){ str=str.replace(new RegExp(from.charAt(i),'g'), to.charAt(i)); } return str; }} ; var smart={ model:{}, view:{}, collection:{}, settings:{}}; var smc={ model:{}, view:{}, collection:{}, settings:{}}; (function($){ smart.base=function(){ var self=this; $.extend(this, { instances:{}, setting:function(name){ return smart.settings[name]; }, is_admin:function(){ return this.setting('is_admin'); }, instance:function(cls){ if(!this.instances[cls]){ if(real_class=this.class_find(cls)){ var obj=new real_class; if(obj.register) obj.register(); this.instances[cls]=obj; }} return this.instances[cls]; }, class_find:function(cls, type){ type=type||'model'; var classes=(cls instanceof Array) ? cls:[cls]; for (var i=0; i < classes.length; i++){ var vcls=classes[i]; if(smart[type][vcls]){ return smart[type][vcls]; }} }, create_apply:function(constructor, args){ var args=[null].concat(args); var factoryFunction=constructor.bind.apply(constructor, args); return new factoryFunction(); }, class_collect_info:function(cls, info){ info=info||{}; if(!smart.settings||!smart.settings['class_info']) return info; classes=(cls instanceof Array) ? cls:[cls]; classes.reverse(); for (var i=0; i < classes.length; i++){ if(class_info=smart.settings['class_info'][classes[i]]){ $.extend(info, class_info); }} return info; }, behaviors_attach:function(context){ sm().events().do_action('sm/behaviors/attach', context); }, behaviors_detach:function(context){ sm().events().do_action('sm/behaviors/detach', context); }, core:function (){ return this.instance('sm_core'); }, events:function (){ if(!this._events) this._events=new smart.model.sm_events; return this._events; }, form:function (){ return this.instance('sm_form'); }, views:function (){ return this.instance('sm_coms'); }, processor:function (){ return this.instance('sm_processor'); }}); return this; }; smart.model.sm_base=Backbone.Model.extend({ idAttribute: "sm_class" }); smart.model.sm_registerable=smart.model.sm_base.extend({ sm_class:'sm_registerable', constructor: function(info, options){ info=sm().class_collect_info(this.sm_class, info); Backbone.Model.apply(this, arguments); }, register:function (){ this.register_events(); }, register_events:function (){ }}); smart.model.sm_component=smart.model.sm_registerable.extend({ }); smart.collection.sm_collection=Backbone.Collection.extend({ static_set: false, static_ids: [], initialize:function (){ var self=this; this._super(); if(this.static_set){ this.on("add", function(item){ self.static_ids.push(item.id); }); }}, get_static_ids:function (){ return this.static_ids; }}); })(jQuery); var sm=function (){ if(!smart.base_instance) smart.base_instance=new smart.base(); return smart.base_instance; }; jQuery(document).ready(function($){ sm().core(); $(document).ready(function($){ $(document).trigger('sm/processor/registered', [sm_processor()]); sm().behaviors_attach(document.body); document.addEventListener("DOMNodeInserted", function (e){ if(e.target.nodeType==Node.ELEMENT_NODE){ sm().behaviors_attach(e.target); }}, false); }); }); ;(function($){ smart.model.sm_events=function(){ this.sm_class='sm_events'; var slice=Array.prototype.slice; var methods_available={ remove_filter:remove_filter, apply_filters:apply_filters, add_filter:add_filter, remove_action:remove_action, do_action:do_action, add_action:add_action, run_hook: run_hook, get_hooks: get_hooks }; var STORAGE={ actions:{}, filters:{}}; function add_action(action, callback, priority, context){ if(typeof action==='string'&&typeof callback==='function'){ priority=parseInt(( priority||10), 10); _add_hook('actions', action, callback, priority, context); } return methods_available; } function do_action(){ var args=slice.call(arguments); var action=args.shift(); if(typeof action==='string'){ _run_hook('actions', action, args); } return methods_available; } function remove_action(action, callback){ if(typeof action==='string'){ _remove_hook('actions', action, callback); } return methods_available; } function add_filter(filter, callback, priority, context){ if(typeof filter==='string'&&typeof callback==='function'){ priority=parseInt(( priority||10), 10); _add_hook('filters', filter, callback, priority, context); } return methods_available; } function apply_filters(){ var args=slice.call(arguments); var filter=args.shift(); if(typeof filter==='string'){ return _run_hook('filters', filter, args); } return methods_available; } function remove_filter(filter, callback){ if(typeof filter==='string'){ _remove_hook('filters', filter, callback); } return methods_available; } function _remove_hook(type, hook, callback, context){ var handlers, handler, i; if(!STORAGE[ type ][ hook ]){ return; } if(!callback){ STORAGE[ type ][ hook ]=[]; }else{ handlers=STORAGE[ type ][ hook ]; if(!context){ for(i=handlers.length; i--;){ if(handlers[i].callback===callback){ handlers.splice(i, 1); }} }else{ for(i=handlers.length; i--;){ handler=handlers[i]; if(handler.callback===callback&&handler.context===context){ handlers.splice(i, 1); }} }} } function _add_hook(type, hook, callback, priority, context){ var hookObject={ callback:callback, priority:priority, context:context }; var hooks=STORAGE[ type ][ hook ]; if(hooks){ hooks.push(hookObject); hooks=_hook_insert_sort(hooks); }else{ hooks=[ hookObject ]; } STORAGE[ type ][ hook ]=hooks; } function _hook_insert_sort(hooks){ var tmpHook, j, prevHook; for(var i=1, len=hooks.length; i < len; i++){ tmpHook=hooks[ i ]; j=i; while(( prevHook=hooks[ j - 1 ])&&prevHook.priority > tmpHook.priority){ hooks[ j ]=hooks[ j - 1 ]; --j; } hooks[ j ]=tmpHook; } return hooks; } function _run_hook(type, hook, args, context){ var handlers=STORAGE[ type ][ hook ], i, len; if(!handlers){ return (type==='filters') ? args[0]:false; } len=handlers.length; if(type==='filters'){ for(i=0; i < len; i++){ args[ 0 ]=handlers[ i ].callback.apply(context||handlers[ i ].context, args); }}else{ for(i=0; i < len; i++){ handlers[ i ].callback.apply(context||handlers[ i ].context, args); }} return(type==='filters') ? args[ 0 ]:true; } function run_hook(type, hook, args, context){ return _run_hook(type, hook, args, context); } function get_hooks(type, namespace, subkeys){ var results={}; $.each(STORAGE[type], function (key, item){ if(namespace){ if(key.indexOf(namespace)==0){ if(subkeys){ results[key.substr(namespace.length)]=item; }else{ results[key]=item; }} }else{ results[key]=item; }}); return results; } return methods_available; };})(jQuery); ;(function($){ smart.model.sm_processor=smart.model.sm_component.extend({ sm_class: 'sm_processor', processors:{}, processors_selectors:{}, components:{}, add_component: function (name, com){ var self=this; self.components[name]=com; }, register_events:function (){ this._super(); sm().events().add_action('sm/behaviors/attach', this._action_behaviors_attach, 10, this); sm().events().add_action('sm/behaviors/detach', this._action_behaviors_detach, 10, this); }, _action_behaviors_attach: function (context){ var self=this; var found_elements=context.querySelectorAll('[data-boot]'); if(sm_util.find_attribute_start_with(context, 'data-boot')){ found_elements.push(context); } if(found_elements.length){ var jCollection=$().add(found_elements).not('.sm-processed'); $.each(self.processors_selectors, function (selector, info){ jCollection.filter(selector).each(function (){ var obj, data; var $element=$(this); data={ '$el':$element, 'attr_params':$element.data(selector.substring(6, selector.length-1))||{}, 'observe_params':info.params||{}}; data.params=$.extend({}, data.observe_params, data.attr_params); if(info.type=='function'){ info.cb.apply(data); } else if(info.type=='component'){ obj=new info.cb($element, data.params); obj.initialize(); }}); }); jCollection.addClass('sm-processed'); }}, _action_behaviors_detach: function (context){ /* context.find(processors_selector).andSelf().filter(processors_selector).each(function (){ var elm=$(this); $.each(this.attributes, function(index, attribute){ action=attribute.name.replace(/^data-sm-/, ''); }); }); */ }, observeFunction:function (selector, cb, params){ this.processors_selectors[selector]={ cb: cb, params: params, type: 'function' };}, observeComponent:function (selector, cb, params){ this.processors_selectors[selector]={ cb: cb, params: params, type: 'component' };}, add_processor:function (action, callback, priority, context){ this.processors[action]=callback; sm().events().add_action('sm/process/'+action, callback, priority, context); $.fn[action.replace('-','_')]=function (p1, p2){ self.process(action, this, p1, p2); }}, get_processors_selector:function (cls){ cls=cls||''; return cls + '[data-sm-' + Object.keys(this.processors).join('],' + cls + '[data-sm-') + ']'; }, process:function (action, elements){ sm().events().run_hook('actions', 'sm/process/'+action, Array.prototype.slice.call(arguments, 1)); }}); window.sm_processor=function (){ return sm().instance('sm_processor'); }})(jQuery); jQuery(document).ready(function($){ sm_processor(); }); ;(function($){ sm_processor().add_component('popup_admin_link', { apply:function(){ this.$el.click(function(){ url=$(this).attr('href'); url=$.url.addparam(url, {'sm-popup-admin':1}); var dialog=$('
'); dialog.dialog({ dialogClass: "sm-popup-admin-dialog", autoOpen: true, modal: true, width: '80%', height: '700', title: 'Editor' }); return false; }); }}); })(jQuery);